namespace Database.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class initDatabase : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.BacChiuLua",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.User",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Username = c.String(nullable: false, maxLength: 255),
                        Password = c.String(nullable: false, maxLength: 255),
                        FullName = c.String(nullable: false, maxLength: 255),
                        CreatedById = c.Int(),
                        ModifiedById = c.Int(),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        Role_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedById)
                .ForeignKey("dbo.User", t => t.ModifiedById)
                .ForeignKey("dbo.Role", t => t.Role_Id)
                .Index(t => t.CreatedById)
                .Index(t => t.ModifiedById)
                .Index(t => t.Role_Id);
            
            CreateTable(
                "dbo.Role",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        RoleName = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        User_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.User", t => t.User_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.User_Id);
            
            CreateTable(
                "dbo.HangMuc",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        TenCongTrinh = c.String(nullable: false, maxLength: 255),
                        DienTichM2 = c.Int(),
                        SoTang = c.Int(),
                        DienTichM3 = c.Int(),
                        SoPhong = c.Int(),
                        TenChatChay = c.String(maxLength: 255),
                        DienTichChatChayM2 = c.Int(),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        BacChiuLua_Id = c.Int(),
                        CreatedBy_Id = c.Int(),
                        HangSanXuat_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        PhieuDieuTraCoSo_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.BacChiuLua", t => t.BacChiuLua_Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.HangSanXuat", t => t.HangSanXuat_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.PhieuDieuTraCoSo", t => t.PhieuDieuTraCoSo_Id)
                .Index(t => t.BacChiuLua_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.HangSanXuat_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.PhieuDieuTraCoSo_Id);
            
            CreateTable(
                "dbo.HangSanXuat",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.PhieuDieuTraCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        TenCoSo = c.String(),
                        Email = c.String(),
                        Website = c.String(),
                        NamThanhLap = c.String(),
                        DiaChi_So = c.String(),
                        DiaChi_Duong = c.String(),
                        DiaChi_PhuongOrXa = c.String(),
                        DiaChi_QuanOrHuyen = c.String(),
                        KhuOrCumCongNghiep = c.String(),
                        NguoiDungDauCoSo = c.String(),
                        DienThoai = c.String(),
                        CoQuanQuanLyID = c.Int(),
                        NgayLapPhieu = c.DateTime(),
                        CanBoQuanLyID = c.Int(),
                        PhongID = c.Int(),
                        DoiID = c.Int(),
                        CapQuanLyHanhChinhID = c.Int(),
                        HinhThucDauTuID = c.Int(),
                        ThanhPhanKinhTeID = c.Int(),
                        NganhLinhVucID = c.Int(),
                        LoaiHinhHoatDongID = c.Int(),
                        ThamDuyetPCCCID = c.Int(),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        CapQuanLyHanhChinhCoSo_Id = c.Int(),
                        CoQuanQuanLyPCCC_Id = c.Int(),
                        LoaiCoSo_Id = c.Int(),
                        QuanHuyen_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.Doi", t => t.DoiID)
                .ForeignKey("dbo.HinhThucDauTuCoSo", t => t.HinhThucDauTuID)
                .ForeignKey("dbo.LoaiHinhHoatDongCoSo", t => t.LoaiHinhHoatDongID)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.NganhLinhVucCoSo", t => t.NganhLinhVucID)
                .ForeignKey("dbo.ThanhPhanKinhTeCoSo", t => t.ThanhPhanKinhTeID)
                .ForeignKey("dbo.CapQuanLyHanhChinhCoSo", t => t.CapQuanLyHanhChinhCoSo_Id)
                .ForeignKey("dbo.CoQuanQuanLyPCCC", t => t.CoQuanQuanLyPCCC_Id)
                .ForeignKey("dbo.LoaiCoSo", t => t.LoaiCoSo_Id)
                .ForeignKey("dbo.QuanHuyen", t => t.QuanHuyen_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.DoiID)
                .Index(t => t.HinhThucDauTuID)
                .Index(t => t.LoaiHinhHoatDongID)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.NganhLinhVucID)
                .Index(t => t.ThanhPhanKinhTeID)
                .Index(t => t.CapQuanLyHanhChinhCoSo_Id)
                .Index(t => t.CoQuanQuanLyPCCC_Id)
                .Index(t => t.LoaiCoSo_Id)
                .Index(t => t.QuanHuyen_Id);
            
            CreateTable(
                "dbo.Doi",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        TenDoi = c.String(nullable: false, maxLength: 255),
                        DienGiai = c.String(maxLength: 2000),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        Phong_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.Phong", t => t.Phong_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.Phong_Id);
            
            CreateTable(
                "dbo.CanBo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        HoTen = c.String(nullable: false, maxLength: 255),
                        DienThoai = c.String(maxLength: 255),
                        DienGiai = c.String(maxLength: 2000),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        Doi_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.Doi", t => t.Doi_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.Doi_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.Phong",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ma = c.String(nullable: false, maxLength: 255),
                        TenPhong = c.String(nullable: false, maxLength: 255),
                        DienGiai = c.String(maxLength: 2000),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.HinhThucDauTuCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ma = c.String(nullable: false, maxLength: 255),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.KiemTraAnToan",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ngay = c.DateTime(nullable: false),
                        CheDoKiemTra = c.String(),
                        TonTai = c.String(),
                        KienNghi = c.String(),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        PhieuDieuTraCoSoes_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.PhieuDieuTraCoSo", t => t.PhieuDieuTraCoSoes_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.PhieuDieuTraCoSoes_Id);
            
            CreateTable(
                "dbo.LoaiHinhHoatDongCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ma = c.String(nullable: false, maxLength: 255),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.NganhLinhVucCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ma = c.String(nullable: false, maxLength: 255),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.NguonNuoc",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        TrongCoSo = c.String(maxLength: 255),
                        NgoaiCoSo = c.String(maxLength: 255),
                        KhoiTich = c.String(maxLength: 255),
                        XeCC = c.String(maxLength: 255),
                        MBCC = c.String(maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        PhanLoaiChiTietNguonNuoc_Id = c.Int(),
                        PhieuDieuTraCoSoes_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.PhanLoaiChiTietNguonNuoc", t => t.PhanLoaiChiTietNguonNuoc_Id)
                .ForeignKey("dbo.PhieuDieuTraCoSo", t => t.PhieuDieuTraCoSoes_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.PhanLoaiChiTietNguonNuoc_Id)
                .Index(t => t.PhieuDieuTraCoSoes_Id);
            
            CreateTable(
                "dbo.PhanLoaiChiTietNguonNuoc",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        LoaiNguonNuoc_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.LoaiNguonNuoc", t => t.LoaiNguonNuoc_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.LoaiNguonNuoc_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.LoaiNguonNuoc",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.PhuongTienCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        SoLuong = c.Int(),
                        TinhTrangHoatDong_Tot = c.Int(),
                        TinhTrangHoatDong_TrungBinh = c.Int(),
                        TinhTrangHoatDong_Kem = c.Int(),
                        TinhTrangHoatDong_HuHong = c.Int(),
                        Vitri = c.String(),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        PhanLoaiChiTietPhuongTiens_Id = c.Int(),
                        PhieuDieuTraCoSoes_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.PhanLoaiChiTietPhuongTienPCCCCoSo", t => t.PhanLoaiChiTietPhuongTiens_Id)
                .ForeignKey("dbo.PhieuDieuTraCoSo", t => t.PhieuDieuTraCoSoes_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.PhanLoaiChiTietPhuongTiens_Id)
                .Index(t => t.PhieuDieuTraCoSoes_Id);
            
            CreateTable(
                "dbo.PhanLoaiChiTietPhuongTienPCCCCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        NhomPhuongTienCoSoes_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.NhomPhuongTienPCCCCoSo", t => t.NhomPhuongTienCoSoes_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.NhomPhuongTienCoSoes_Id);
            
            CreateTable(
                "dbo.NhomPhuongTienPCCCCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.TuyenTruyenHuanLuyen",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ngay = c.DateTime(nullable: false),
                        ThoiLuong = c.Int(nullable: false),
                        NoiDung = c.String(),
                        LucLuongPCCCCoSo = c.Int(nullable: false),
                        CanBoQuanLy = c.Int(nullable: false),
                        NguoiLaoDong = c.Int(nullable: false),
                        DoiTuongKhac = c.Int(nullable: false),
                        SoGiayCN = c.String(),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        PhieuDieuTraCoSo_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.PhieuDieuTraCoSo", t => t.PhieuDieuTraCoSo_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.PhieuDieuTraCoSo_Id);
            
            CreateTable(
                "dbo.ThamDuyetPCCC",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        SoVanBan = c.String(nullable: false, maxLength: 255),
                        NgayCap = c.DateTime(nullable: false),
                        GhiChu = c.String(maxLength: 1000),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CoQuanCapVanBanThamDuyet_Id = c.Int(),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        PhieuDieuTraCoSo_Id = c.Int(),
                        VanBanThamDuyet_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.CoQuanCapVanBanThamDuyet", t => t.CoQuanCapVanBanThamDuyet_Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.PhieuDieuTraCoSo", t => t.PhieuDieuTraCoSo_Id)
                .ForeignKey("dbo.VanBanThamDuyetPCCC", t => t.VanBanThamDuyet_Id)
                .Index(t => t.CoQuanCapVanBanThamDuyet_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.PhieuDieuTraCoSo_Id)
                .Index(t => t.VanBanThamDuyet_Id);
            
            CreateTable(
                "dbo.CoQuanCapVanBanThamDuyet",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.VanBanThamDuyetPCCC",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.ThanhPhanKinhTeCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ma = c.String(nullable: false, maxLength: 255),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.XuLyViPham",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ngay = c.DateTime(nullable: false),
                        DoiTuongViPham = c.String(),
                        NoiDung = c.String(),
                        CanhCao = c.String(),
                        PhatTien = c.String(),
                        NgayTamDinhChi = c.DateTime(nullable: false),
                        NgayPhucHoi = c.DateTime(nullable: false),
                        DinhChi = c.String(),
                        BienPhapXuLyKhac = c.String(),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        NhomHanhVi_Id = c.Int(),
                        PhieuDieuTraCoSoes_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.NhomHanhVi", t => t.NhomHanhVi_Id)
                .ForeignKey("dbo.PhieuDieuTraCoSo", t => t.PhieuDieuTraCoSoes_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.NhomHanhVi_Id)
                .Index(t => t.PhieuDieuTraCoSoes_Id);
            
            CreateTable(
                "dbo.NhomHanhVi",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.CapQuanLyHanhChinhCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ma = c.String(nullable: false, maxLength: 255),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.CoQuanQuanLyPCCC",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        DienGiai = c.String(),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.LoaiCoSo",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ma = c.String(nullable: false, maxLength: 255),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.NhomPhuongTien",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.PhanLoaiChiTietPhuongTien",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        NhomPhuongTien_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.NhomPhuongTien", t => t.NhomPhuongTien_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.NhomPhuongTien_Id);
            
            CreateTable(
                "dbo.PhuongTien",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                        PhanLoaiChiTietPhuongTiens_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .ForeignKey("dbo.PhanLoaiChiTietPhuongTien", t => t.PhanLoaiChiTietPhuongTiens_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id)
                .Index(t => t.PhanLoaiChiTietPhuongTiens_Id);
            
            CreateTable(
                "dbo.QuanHuyen",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ma = c.String(nullable: false, maxLength: 255),
                        Ten = c.String(nullable: false, maxLength: 255),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
            CreateTable(
                "dbo.ThoiDiem",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Ten = c.String(nullable: false, maxLength: 255),
                        From = c.Int(nullable: false),
                        To = c.Int(nullable: false),
                        Created = c.DateTime(nullable: false),
                        Modified = c.DateTime(nullable: false),
                        CreatedBy_Id = c.Int(),
                        ModifiedBy_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.User", t => t.CreatedBy_Id)
                .ForeignKey("dbo.User", t => t.ModifiedBy_Id)
                .Index(t => t.CreatedBy_Id)
                .Index(t => t.ModifiedBy_Id);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.ThoiDiem", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.ThoiDiem", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "QuanHuyen_Id", "dbo.QuanHuyen");
            DropForeignKey("dbo.QuanHuyen", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.QuanHuyen", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhuongTien", "PhanLoaiChiTietPhuongTiens_Id", "dbo.PhanLoaiChiTietPhuongTien");
            DropForeignKey("dbo.PhuongTien", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhuongTien", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhanLoaiChiTietPhuongTien", "NhomPhuongTien_Id", "dbo.NhomPhuongTien");
            DropForeignKey("dbo.PhanLoaiChiTietPhuongTien", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhanLoaiChiTietPhuongTien", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.NhomPhuongTien", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.NhomPhuongTien", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "LoaiCoSo_Id", "dbo.LoaiCoSo");
            DropForeignKey("dbo.LoaiCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.LoaiCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "CoQuanQuanLyPCCC_Id", "dbo.CoQuanQuanLyPCCC");
            DropForeignKey("dbo.CoQuanQuanLyPCCC", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.CoQuanQuanLyPCCC", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "CapQuanLyHanhChinhCoSo_Id", "dbo.CapQuanLyHanhChinhCoSo");
            DropForeignKey("dbo.CapQuanLyHanhChinhCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.CapQuanLyHanhChinhCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.BacChiuLua", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.HangMuc", "PhieuDieuTraCoSo_Id", "dbo.PhieuDieuTraCoSo");
            DropForeignKey("dbo.XuLyViPham", "PhieuDieuTraCoSoes_Id", "dbo.PhieuDieuTraCoSo");
            DropForeignKey("dbo.XuLyViPham", "NhomHanhVi_Id", "dbo.NhomHanhVi");
            DropForeignKey("dbo.NhomHanhVi", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.NhomHanhVi", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.XuLyViPham", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.XuLyViPham", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "ThanhPhanKinhTeID", "dbo.ThanhPhanKinhTeCoSo");
            DropForeignKey("dbo.ThanhPhanKinhTeCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.ThanhPhanKinhTeCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.ThamDuyetPCCC", "VanBanThamDuyet_Id", "dbo.VanBanThamDuyetPCCC");
            DropForeignKey("dbo.VanBanThamDuyetPCCC", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.VanBanThamDuyetPCCC", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.ThamDuyetPCCC", "PhieuDieuTraCoSo_Id", "dbo.PhieuDieuTraCoSo");
            DropForeignKey("dbo.ThamDuyetPCCC", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.ThamDuyetPCCC", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.ThamDuyetPCCC", "CoQuanCapVanBanThamDuyet_Id", "dbo.CoQuanCapVanBanThamDuyet");
            DropForeignKey("dbo.CoQuanCapVanBanThamDuyet", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.CoQuanCapVanBanThamDuyet", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.TuyenTruyenHuanLuyen", "PhieuDieuTraCoSo_Id", "dbo.PhieuDieuTraCoSo");
            DropForeignKey("dbo.TuyenTruyenHuanLuyen", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.TuyenTruyenHuanLuyen", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhuongTienCoSo", "PhieuDieuTraCoSoes_Id", "dbo.PhieuDieuTraCoSo");
            DropForeignKey("dbo.PhuongTienCoSo", "PhanLoaiChiTietPhuongTiens_Id", "dbo.PhanLoaiChiTietPhuongTienPCCCCoSo");
            DropForeignKey("dbo.PhanLoaiChiTietPhuongTienPCCCCoSo", "NhomPhuongTienCoSoes_Id", "dbo.NhomPhuongTienPCCCCoSo");
            DropForeignKey("dbo.NhomPhuongTienPCCCCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.NhomPhuongTienPCCCCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhanLoaiChiTietPhuongTienPCCCCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhanLoaiChiTietPhuongTienPCCCCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhuongTienCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhuongTienCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.NguonNuoc", "PhieuDieuTraCoSoes_Id", "dbo.PhieuDieuTraCoSo");
            DropForeignKey("dbo.NguonNuoc", "PhanLoaiChiTietNguonNuoc_Id", "dbo.PhanLoaiChiTietNguonNuoc");
            DropForeignKey("dbo.PhanLoaiChiTietNguonNuoc", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhanLoaiChiTietNguonNuoc", "LoaiNguonNuoc_Id", "dbo.LoaiNguonNuoc");
            DropForeignKey("dbo.LoaiNguonNuoc", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.LoaiNguonNuoc", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhanLoaiChiTietNguonNuoc", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.NguonNuoc", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.NguonNuoc", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "NganhLinhVucID", "dbo.NganhLinhVucCoSo");
            DropForeignKey("dbo.NganhLinhVucCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.NganhLinhVucCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "LoaiHinhHoatDongID", "dbo.LoaiHinhHoatDongCoSo");
            DropForeignKey("dbo.LoaiHinhHoatDongCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.LoaiHinhHoatDongCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.KiemTraAnToan", "PhieuDieuTraCoSoes_Id", "dbo.PhieuDieuTraCoSo");
            DropForeignKey("dbo.KiemTraAnToan", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.KiemTraAnToan", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "HinhThucDauTuID", "dbo.HinhThucDauTuCoSo");
            DropForeignKey("dbo.HinhThucDauTuCoSo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.HinhThucDauTuCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "DoiID", "dbo.Doi");
            DropForeignKey("dbo.Phong", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.Doi", "Phong_Id", "dbo.Phong");
            DropForeignKey("dbo.Phong", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.Doi", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.Doi", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.CanBo", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.CanBo", "Doi_Id", "dbo.Doi");
            DropForeignKey("dbo.CanBo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.PhieuDieuTraCoSo", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.HangMuc", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.HangSanXuat", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.HangMuc", "HangSanXuat_Id", "dbo.HangSanXuat");
            DropForeignKey("dbo.HangSanXuat", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.HangMuc", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.HangMuc", "BacChiuLua_Id", "dbo.BacChiuLua");
            DropForeignKey("dbo.BacChiuLua", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.Role", "User_Id", "dbo.User");
            DropForeignKey("dbo.User", "Role_Id", "dbo.Role");
            DropForeignKey("dbo.Role", "ModifiedBy_Id", "dbo.User");
            DropForeignKey("dbo.Role", "CreatedBy_Id", "dbo.User");
            DropForeignKey("dbo.User", "ModifiedById", "dbo.User");
            DropForeignKey("dbo.User", "CreatedById", "dbo.User");
            DropIndex("dbo.ThoiDiem", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.ThoiDiem", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "QuanHuyen_Id" });
            DropIndex("dbo.QuanHuyen", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.QuanHuyen", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhuongTien", new[] { "PhanLoaiChiTietPhuongTiens_Id" });
            DropIndex("dbo.PhuongTien", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.PhuongTien", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhanLoaiChiTietPhuongTien", new[] { "NhomPhuongTien_Id" });
            DropIndex("dbo.PhanLoaiChiTietPhuongTien", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.PhanLoaiChiTietPhuongTien", new[] { "CreatedBy_Id" });
            DropIndex("dbo.NhomPhuongTien", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.NhomPhuongTien", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "LoaiCoSo_Id" });
            DropIndex("dbo.LoaiCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.LoaiCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "CoQuanQuanLyPCCC_Id" });
            DropIndex("dbo.CoQuanQuanLyPCCC", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.CoQuanQuanLyPCCC", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "CapQuanLyHanhChinhCoSo_Id" });
            DropIndex("dbo.CapQuanLyHanhChinhCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.CapQuanLyHanhChinhCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.BacChiuLua", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.HangMuc", new[] { "PhieuDieuTraCoSo_Id" });
            DropIndex("dbo.XuLyViPham", new[] { "PhieuDieuTraCoSoes_Id" });
            DropIndex("dbo.XuLyViPham", new[] { "NhomHanhVi_Id" });
            DropIndex("dbo.NhomHanhVi", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.NhomHanhVi", new[] { "CreatedBy_Id" });
            DropIndex("dbo.XuLyViPham", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.XuLyViPham", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "ThanhPhanKinhTeID" });
            DropIndex("dbo.ThanhPhanKinhTeCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.ThanhPhanKinhTeCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.ThamDuyetPCCC", new[] { "VanBanThamDuyet_Id" });
            DropIndex("dbo.VanBanThamDuyetPCCC", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.VanBanThamDuyetPCCC", new[] { "CreatedBy_Id" });
            DropIndex("dbo.ThamDuyetPCCC", new[] { "PhieuDieuTraCoSo_Id" });
            DropIndex("dbo.ThamDuyetPCCC", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.ThamDuyetPCCC", new[] { "CreatedBy_Id" });
            DropIndex("dbo.ThamDuyetPCCC", new[] { "CoQuanCapVanBanThamDuyet_Id" });
            DropIndex("dbo.CoQuanCapVanBanThamDuyet", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.CoQuanCapVanBanThamDuyet", new[] { "CreatedBy_Id" });
            DropIndex("dbo.TuyenTruyenHuanLuyen", new[] { "PhieuDieuTraCoSo_Id" });
            DropIndex("dbo.TuyenTruyenHuanLuyen", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.TuyenTruyenHuanLuyen", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhuongTienCoSo", new[] { "PhieuDieuTraCoSoes_Id" });
            DropIndex("dbo.PhuongTienCoSo", new[] { "PhanLoaiChiTietPhuongTiens_Id" });
            DropIndex("dbo.PhanLoaiChiTietPhuongTienPCCCCoSo", new[] { "NhomPhuongTienCoSoes_Id" });
            DropIndex("dbo.NhomPhuongTienPCCCCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.NhomPhuongTienPCCCCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhanLoaiChiTietPhuongTienPCCCCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.PhanLoaiChiTietPhuongTienPCCCCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhuongTienCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.PhuongTienCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.NguonNuoc", new[] { "PhieuDieuTraCoSoes_Id" });
            DropIndex("dbo.NguonNuoc", new[] { "PhanLoaiChiTietNguonNuoc_Id" });
            DropIndex("dbo.PhanLoaiChiTietNguonNuoc", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.PhanLoaiChiTietNguonNuoc", new[] { "LoaiNguonNuoc_Id" });
            DropIndex("dbo.LoaiNguonNuoc", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.LoaiNguonNuoc", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhanLoaiChiTietNguonNuoc", new[] { "CreatedBy_Id" });
            DropIndex("dbo.NguonNuoc", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.NguonNuoc", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "NganhLinhVucID" });
            DropIndex("dbo.NganhLinhVucCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.NganhLinhVucCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "LoaiHinhHoatDongID" });
            DropIndex("dbo.LoaiHinhHoatDongCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.LoaiHinhHoatDongCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.KiemTraAnToan", new[] { "PhieuDieuTraCoSoes_Id" });
            DropIndex("dbo.KiemTraAnToan", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.KiemTraAnToan", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "HinhThucDauTuID" });
            DropIndex("dbo.HinhThucDauTuCoSo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.HinhThucDauTuCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "DoiID" });
            DropIndex("dbo.Phong", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.Doi", new[] { "Phong_Id" });
            DropIndex("dbo.Phong", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Doi", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.Doi", new[] { "CreatedBy_Id" });
            DropIndex("dbo.CanBo", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.CanBo", new[] { "Doi_Id" });
            DropIndex("dbo.CanBo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.PhieuDieuTraCoSo", new[] { "CreatedBy_Id" });
            DropIndex("dbo.HangMuc", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.HangSanXuat", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.HangMuc", new[] { "HangSanXuat_Id" });
            DropIndex("dbo.HangSanXuat", new[] { "CreatedBy_Id" });
            DropIndex("dbo.HangMuc", new[] { "CreatedBy_Id" });
            DropIndex("dbo.HangMuc", new[] { "BacChiuLua_Id" });
            DropIndex("dbo.BacChiuLua", new[] { "CreatedBy_Id" });
            DropIndex("dbo.Role", new[] { "User_Id" });
            DropIndex("dbo.User", new[] { "Role_Id" });
            DropIndex("dbo.Role", new[] { "ModifiedBy_Id" });
            DropIndex("dbo.Role", new[] { "CreatedBy_Id" });
            DropIndex("dbo.User", new[] { "ModifiedById" });
            DropIndex("dbo.User", new[] { "CreatedById" });
            DropTable("dbo.ThoiDiem");
            DropTable("dbo.QuanHuyen");
            DropTable("dbo.PhuongTien");
            DropTable("dbo.PhanLoaiChiTietPhuongTien");
            DropTable("dbo.NhomPhuongTien");
            DropTable("dbo.LoaiCoSo");
            DropTable("dbo.CoQuanQuanLyPCCC");
            DropTable("dbo.CapQuanLyHanhChinhCoSo");
            DropTable("dbo.NhomHanhVi");
            DropTable("dbo.XuLyViPham");
            DropTable("dbo.ThanhPhanKinhTeCoSo");
            DropTable("dbo.VanBanThamDuyetPCCC");
            DropTable("dbo.CoQuanCapVanBanThamDuyet");
            DropTable("dbo.ThamDuyetPCCC");
            DropTable("dbo.TuyenTruyenHuanLuyen");
            DropTable("dbo.NhomPhuongTienPCCCCoSo");
            DropTable("dbo.PhanLoaiChiTietPhuongTienPCCCCoSo");
            DropTable("dbo.PhuongTienCoSo");
            DropTable("dbo.LoaiNguonNuoc");
            DropTable("dbo.PhanLoaiChiTietNguonNuoc");
            DropTable("dbo.NguonNuoc");
            DropTable("dbo.NganhLinhVucCoSo");
            DropTable("dbo.LoaiHinhHoatDongCoSo");
            DropTable("dbo.KiemTraAnToan");
            DropTable("dbo.HinhThucDauTuCoSo");
            DropTable("dbo.Phong");
            DropTable("dbo.CanBo");
            DropTable("dbo.Doi");
            DropTable("dbo.PhieuDieuTraCoSo");
            DropTable("dbo.HangSanXuat");
            DropTable("dbo.HangMuc");
            DropTable("dbo.Role");
            DropTable("dbo.User");
            DropTable("dbo.BacChiuLua");
        }
    }
}
